/* Equipment.cs
 * Author: Richard Broker
 * 
 *  This file is part of Tame.
 *
 *  Tame is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Tame is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with Tame. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Tame
{
    class Equipment
    {
        public int shieldReturnData { get; set; }
        public int driveReturnData { get; set; }

         public static void Initialize()
        {
        }

         #region DataArrays Drive/Armor/Shield/Missile/Special
         // Drive Data Array
            // Format: {speed, fuel usage, tank size, weight, evasion bonus, cost, rankrequirement}
            int[,] driveData = {
                                   {0,0,0,0,0,0,0}, /* 0: None */
                                   {1, 100, 2, 22, 0, 4000, 0}, /* 1. Nuclear Drive */
                                   {2, 125, 3, 26, 4, 20000, 0}, /* 2. Fusion Drive */
                                   {2, 100, 4, 25, 20, 40000, 15}, /* 3. Enhanced Fusion Drive */
                                   {3, 150, 3, 35, 8, 48000, 0}, /* 4. Ion Drive */
                                   {4, 200, 6, 55, 12, 92000, 0}, /* 5. Antimatter */
                                   {4,150, 7, 51, 28, 184000, 18}, /* 6. Enhanced Antimatter Drive */
                                   {5, 225, 8, 73, 16, 220000, 0}, /* 7. Hyper Drive */
                                   {6, 250, 9, 87, 20, 400000, 0}, /* 8. Interphased Drive */
                                   {6, 225, 10, 80, 36, 800000, 112}, /* 0. Enhanced Interphased Drive */
                               };
        

        // Armor Data Array
        private int[,] ArmorData()
        {
            // Format: {strength, cost, rank}
            int[,] armorData = {
                                   {1,6500,0}, /*0. Titanium */
                                   {2, 56000, 0}, /* 1. Tritanium */
                                   {3, 290000, 0}, /* 2. Zortrium */
                                   {4, 935000, 0}, /* 3. Neutronium */
                                   {5, 2870000,0}, /* 4. Adamantium */
                                   {6, 2990000,39}, /* 5. Ebidium */
                                   {2, 190000,0}, /* 6. Worm-Slime */
                                   {3, 435000,0}, /* 7. Mykoplasmic */
                                   {4,1400000,0}, /* 8. Mutagen */
                                   {5,4305000,0}, /* 9. Genotrope */
                                   {2, 200000,0}, /* 10. Fermion */
                                   {3, 464000, 0}, /* 11. Boson */
                                   {4, 1560000, 0}, /* 12. Positron */
                                   {5, 4856000,0}, /* 13. Anti-Neutrino */
                                   {1,6500,0}, /* 14: Pardus I */
                                   {2,56000,0}, /* 15: Pardus II */
                                   {3, 290000,0}, /* 16: Pardus III */
                                   {4,935000,0}, /* 17: Pardus IV */
                                   {5, 2870000,0}, /* 18: Pardus V */
                                   {6, 2990000,39}, /* 19: Pardus VI */
                               };
            return armorData;
        }

            // Shield Data Array
            // Format: {0: points, 1: recharge, 2: mass, 3: cost, 4: requirements}
            int[,] shieldData = {
                                     {60,1,2,1000,31}, /*0: Tiny Shield */
                                     {120,1,4,8000,0}, /*1: Small Shield */
                                     {270,1,11,140000,0},/*2: Standard Shield */
                                     {420,2,28,320000,0}, /*3: Medium Shield */
                                     {660,3,48,740000,0}, /*4: Large */
                                     {120,3,5,10000,33}, /* 5: Q-Small */
                                     {270,3,11,180000,36}, /* 6: Q-Standard */
                                     {400,5,26,400000,37}, /* 7: Q-Medium */
                                     {630,7,46,860000,38}, /* 8: Q-Large */
                                     {870,3,52,820000,39}, /* 9: Huge */
                                     {840,8,52,980000,310}, /* 10: Q-Huge */
                                     {870,3,40,1100000,311}, /*11: L-Huge */
                                     {630,7,35,1160000,312}, /*12: LQ-Large */
                                     {840,8,40,1290000,313} /* 13: LQ-Huge */
                                 };

        // Missile Data Array
        private int[,] MissileData()
        {
            // Format: {0: damage, 1: intelligence, 2: mass, 3: art, 4: cost, 5: rank}
            int[,] missileData = {
                                     {45,1,1,4,1000,0}, // ): P80 Sidewinder
                                     {90,1,1,4,2500,0}, // 1: KL760 Homing
                                     {135,2,2,4,6000,0}, // 2: LV111 Intelligent
                                     {255,2,5,4,16000,0}, // 3: NN500 Fleet
                                     {255,3,5,4,32000,0}, // 4: NN 550 Fleet
                                     {315,3,5,4,17500,26}, // 5: MO89 Lord
                                     {60,4,1,3,1500,22}, // 6: G-7 Smartwinder
                                     {150,2,2,3,7000,24}, // 7: A/50 Pogo
                                     {225,3,4,3,18000,25}, // 8: D/70 Havar
                                     {270,4,5,3,62500,28}, // 9: Elite Mk.I
                                     {270,5,6,3,62500,28}, // 10: Elite Mk.II
                                     {1200,6,20,19,1000000,211}, // 11: King Relon
                                     {1800,6,28,19,1500000,212}, // 12: King Kraak
                                     {2300,3,12,15,2500000,214}, // 13: Royal Redeemer
                                 };
            return missileData;
        }

        // Special Equipment Data Array
        private int[,] SpecialData()
        {
            // Format {0: weight, 1: cost, 2: RANK!},
            int[,] specialData = {
                                     {2,3000,0}, // 0: Auto-Refueller
                                     {5,10000,0}, // 1: Escape Pod
                                     {1,1800,0}, // 2: Fuel Scoop
                                     {2,24000,0}, // 3: Bussard Stripminescoop.
                                     {2,20000,0}, // 4: Magnetic Scoop.
                                     {1,30000,0}, // 5: Ambush Teleporter
                                     {5,25000,0}, // 6: Class I Teleporter
                                     {8,60000,0}, // 7: Class II Teleporter
                                     {0,2000,0}, //8: Map Pack I
                                     {0,7000,0}, //9: Map Pack II
                                     {0,15000,0}, // 10: Bouny Link I
                                     {0, 150000,0}, // 11: Bounty Link II
                                     {0, 375000,0}, // 12: Bounty Link III
                                     {0, 860000,313}, // 13: Gyro Stabiliser I
                                     {0, 2400000,314}, // 14: Gyro Stabiliser II

                                     {1,240000,0}, // 15: ECM Jammer
                                     {1,280000,35}, // 16: Strong ECM Jammer
                                     {1,40000,37}, // 17: ECCM Jammer
                                     {2,340000,311}, // 18: Weak Gas Flux
                                     {2,460000,313}, // 19: Weak Energy Flux
                                     {2,980000,313}, // 20: Strong Gas Flux
                                     {2,1400000,314}, // 21: Strong Energy Flux
                                     {1,7000000,314}, // 22: Key of sheppard
                                     {1,32000,50}, // 23: EPS Contraband - any EPS rank, 50.
                                     {2,200000,3844}, // 24: Cloaker - needs Uni-8, TSS-4.
                                     {3,350000,46}, // 25: Improved Cloaker
                                     {1,60000,3642}, // 26: SW-IF Uni-6, TSS-2.
                                     {1,160000,31147}, // 27: DW-IF Uni 11, TSS-7.
                                     {1,260000,410}, // 28: TW-IF TSS 10.
                                     {1,65000,43}, // 29: Damping Field
                                     {1,190000,48}, // 30. Reinforced Damping Field
                                     {1,650000,412}, // 31. Perfected Damping Field
                                     {6,400000,45}, // 32: Light Demat I
                                     {10,500000,48}, // 33: Medium Demat I
                                     {18,600000,411}, // 34: Heavy Demat I
                                     {6,750000,47}, // 35: Light Demat II
                                     {10,950000,410}, // 36: Medium Demat II
                                     {18,1150000,413}, // 37: Heavy Demat II
                                };
            return specialData;
        }
         #endregion


        public int GetShieldData(ref int mode, string shieldText)
        {
            int[,] tempShieldData = shieldData;
            Equipment infiniteRecursion = new Equipment();

            switch (shieldText)
            {

                case ":: None ::":
                case "":
                    infiniteRecursion.shieldReturnData = 0;
                    return infiniteRecursion.shieldReturnData;

                case "Tiny":
                    infiniteRecursion.shieldReturnData = tempShieldData[0, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Small":
                    infiniteRecursion.shieldReturnData = tempShieldData[1, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Standard":
                    infiniteRecursion.shieldReturnData = tempShieldData[2, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Medium":
                    infiniteRecursion.shieldReturnData = tempShieldData[3, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Large":
                    infiniteRecursion.shieldReturnData = tempShieldData[4, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Q-Small":
                    infiniteRecursion.shieldReturnData = tempShieldData[5, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Q-Standard":
                    infiniteRecursion.shieldReturnData = tempShieldData[6, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Q-Medium":
                    infiniteRecursion.shieldReturnData = tempShieldData[7, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Q-Large":
                    infiniteRecursion.shieldReturnData = tempShieldData[8, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Huge":
                    infiniteRecursion.shieldReturnData = tempShieldData[9, mode];
                    return infiniteRecursion.shieldReturnData;

                case "Q-Huge":
                    infiniteRecursion.shieldReturnData = tempShieldData[10, mode];
                    return infiniteRecursion.shieldReturnData;

                case "L-Huge":
                    infiniteRecursion.shieldReturnData = tempShieldData[11, mode];
                    return infiniteRecursion.shieldReturnData;

                case "LQ-Large":
                    infiniteRecursion.shieldReturnData = tempShieldData[12, mode];
                    return infiniteRecursion.shieldReturnData;

                case "LQ-Huge":
                    infiniteRecursion.shieldReturnData = tempShieldData[13, mode];
                    return infiniteRecursion.shieldReturnData;
            }
            return 0;
        }

        public int GetDriveData(ref int mode, string driveText)
        {
            int[,] tempDriveData = driveData;
            Equipment infiniteRecursion = new Equipment();

            switch (driveText)
            {
                case "":
                case " ":
                case ":: None ::":
                    infiniteRecursion.driveReturnData = tempDriveData[0, mode];
                    return infiniteRecursion.driveReturnData;

                case "Nuclear Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[1, mode];
                    return infiniteRecursion.driveReturnData;

                case "Fusion Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[2, mode];
                    return infiniteRecursion.driveReturnData;

                case "Enhanced Fusion Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[3, mode];
                    return infiniteRecursion.driveReturnData;

                case "Ion Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[4, mode];
                    return infiniteRecursion.driveReturnData;

                case "Antimatter Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[5, mode];
                    return infiniteRecursion.driveReturnData;

                case "Enhanced Antimatter Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[6, mode];
                    return infiniteRecursion.driveReturnData;

                case "Hyper Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[7, mode];
                    return infiniteRecursion.driveReturnData;

                case "Interphased Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[8, mode];
                    return infiniteRecursion.driveReturnData;

                case "Enhanced Interphased Drive":
                    infiniteRecursion.driveReturnData = tempDriveData[9, mode];
                    return infiniteRecursion.driveReturnData;
            }
            return 0;
        }
    }
}
